$(function(){
        var userInfo=null;
        var jsonStr=sessionStorage.getItem("login");
        userInfo=JSON.parse(jsonStr||'{}');

        if(userInfo.uname!=undefined){
            $("#login").text(userInfo.uname);
        }
        $(".inner-left").hover(function(){
            $(this).children("a").css("color","#fa4b9b");
        },function(){
            $(this).children("a").css("color","#666");
        });
        $(".inner-right").find("li").hover(function(){
            $(this).children("a").css("color","#fa4b9b");
        },function(){
            $(this).children("a").css("color","#666");
        });
        $(".search button").hover(function(){
            $(this).css("backgroundColor","#f94282");
        },function(){
            $(this).css("backgroundColor","#fa4b9b");
        });
        $(".cart").on("mouseenter",function(){
            $(".cart-more").show();
            $(this).find("span").show();
            $(this).find("i").css({
                color:"#fa4b9b",
                background:"#fff",
                border:"1px solid #fa4b9b",
                borderBottom:"none",
                borderRight:"none",
                height:"38px",
            })
            $(this).children("a").css({
                border:"1px solid #fa4b9b",
                borderBottom : "none",
                background:"#fff",
                height :"38px",

            })
        })
        $(".cart").on("mouseleave",function(){
            $(".cart-more").hide();
            $(this).find("span").hide();
            $(this).find("i").css({
                color:"",
                background:"",
                border:"",
                borderBottom:"",
                borderRight:"",
                height:"",
            })
            $(this).children("a").css({
                border:"",
                borderBottom : "",
                background:"",
                height :"",

            })
        })
        var oItems=document.querySelectorAll('.items');
        var oNav_down=document.querySelector('.nav-down');
        for(var i=0;i<oItems.length;i++){
            oItems[i].index=i;
            oItems[i].onmouseenter=function(){
                for(var j=1;j<oItems.length;j++){
                    oItems[j].style.backgroundColor="#fa4b9b";
                }
                oItems[this.index].style.backgroundColor="#ec0971";
            }
            oItems[i].onmouseleave=function(){
                oItems[this.index].style.backgroundColor="";
            }
        }
        $(".items").eq(3).on("mouseenter",function(){
            $(this).find("i").css("transform","rotate(-180deg)");
            $(".nav-down").css("display","block");
            $(".nav-down li").css("background","");
        });
        $(".items").eq(3).on("mouseleave",function(){
            $(this).find("i").css("transform","rotate(0deg)");
            $(".nav-down").css("display","none");
        });

        $(".nav-down").on("mouseenter",function(){
            $(".nav-down").css("display","block");
        })
        $(".nav-down").on("mouseleave",function(){
            $(".nav-down").css("display","none");
        })
        $(".nav-down li").on("mouseenter",function(){
            $(this).css({
                background:"#fa4b9b",
                color:"#fff"
            }).siblings("li").css({
                background:"",
                color:""
            });
        })
        $(".pro-menu").hover(function(){
            $(this).find("i").css("transform","rotate(-180deg)");
            $(".menu-detail").show();
        },function(){
            $(this).find("i").css("transform","rotate(0deg)");
            $(".menu-detail").hide();
        });
        var oDl=document.querySelectorAll('.menu-detail>dl');
        var oChildren=document.querySelectorAll('.menu-children');
        var oI=document.querySelectorAll('.icon-circle-right');
        for(var i=0;i<oDl.length;i++){
            oDl[i].index=i;
            oDl[i].onmouseenter=function(){
                for(var j=0;j<oDl.length;j++){
                    oChildren[j].style.display="none";
                    oDl[j].style.borderLeft="";
                    oDl[j].style.background="";
                    oI[j].style.display="";
                }
                oChildren[this.index].style.display="block";
                oDl[this.index].style.borderLeft="3px solid #fb60a7";
                oI[this.index].style.display="none";
                oDl[this.index].style.background="#fff";
            }
            oDl[i].onmouseleave=function(){
                this.style.borderLeft="";
                oChildren[this.index].style.display="none";
                oI[this.index].style.display="";
                oDl[this.index].style.background="";
            }
        }
        $(".menu-detail a").hover(function(){
            $(this).css("color","#fb60a7");
        },function(){
            $(this).css("color","");
        });


})


